package cn.ryh.seataorder.controller;

import cn.ryh.apicommons.domain.Order;
import cn.ryh.apicommons.entities.CommonResult;
import cn.ryh.seataorder.service.OrderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author Rao
 * @Description
 * @create 2022-02-15 9:15
 */
@RestController
public class OrderController {
    @Resource
    private OrderService orderService;


    @PostMapping ("/order/create")
    public CommonResult create(Order order) {
        orderService.create(order);
        return new CommonResult(200, "订单创建成功");
    }

    @GetMapping("/order/test")
    public void test() {
        System.out.println("测试");
    }
}
